/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dnl.utils.swing;

import java.awt.Container;
import java.awt.Frame;
import java.awt.GraphicsConfiguration;
import java.awt.Window;
import javax.swing.JPanel;

/**
 * 
 * @author daniel
 */
public class OkDialog extends Dialog {

    private JPanel contentPane;
    
    private javax.swing.JButton cancelJB;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JButton okJB;

	public OkDialog() {
		initComponents();
	}

	public OkDialog(Dialog owner, boolean modal) {
		super(owner, modal);
		initComponents();
	}

	public OkDialog(Dialog owner, String title, boolean modal) {
		super(owner, title, modal);
		initComponents();
	}

	public OkDialog(Dialog owner, String title) {
		super(owner, title);
		initComponents();
	}

	public OkDialog(Dialog owner) {
		super(owner);
		initComponents();
	}

	public OkDialog(Frame owner, boolean modal) {
		super(owner, modal);
		initComponents();
	}

	public OkDialog(Frame owner, String title, boolean modal, GraphicsConfiguration gc) {
		super(owner, title, modal, gc);
		initComponents();
	}

	public OkDialog(Frame owner, String title, boolean modal) {
		super(owner, title, modal);
		initComponents();
	}

	public OkDialog(Frame owner, String title) {
		super(owner, title);
		initComponents();
	}

	public OkDialog(Frame owner) {
		super(owner);
		initComponents();
	}

	public OkDialog(Window owner, ModalityType modalityType) {
		super(owner, modalityType);
		initComponents();
	}

	public OkDialog(Window owner, String title, ModalityType modalityType) {
		super(owner, title, modalityType);
		initComponents();
	}

	public OkDialog(Window owner, String title) {
		super(owner, title);
		initComponents();
	}

	public OkDialog(Window owner) {
		super(owner);
		initComponents();
	}

	private void initComponents() {

		contentPane = new javax.swing.JPanel();
		jPanel1 = new javax.swing.JPanel();
		okJB = new javax.swing.JButton();
		cancelJB = new javax.swing.JButton();

		setDefaultCloseOperation(DISPOSE_ON_CLOSE);

		jPanel1.setPreferredSize(new java.awt.Dimension(400, 50));

		okJB.setText("OK");
		okJB.setPreferredSize(new java.awt.Dimension(90, 26));
		okJB.addActionListener(new java.awt.event.ActionListener() {
            @Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				okJBActionPerformed(evt);
			}
		});
		jPanel1.add(okJB);

		cancelJB.setText("Cancel");
		cancelJB.setPreferredSize(new java.awt.Dimension(90, 26));
		cancelJB.addActionListener(new java.awt.event.ActionListener() {
            @Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				cancelJBActionPerformed(evt);
			}
		});
		jPanel1.add(cancelJB);

		super.getContentPane().add(jPanel1, java.awt.BorderLayout.SOUTH);
		super.getContentPane().add(contentPane, java.awt.BorderLayout.CENTER);

		pack();
	}// </editor-fold>//GEN-END:initComponents

	private void cancelJBActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_cancelJBActionPerformed
		setCancelled(true);
		setVisible(false);
	}// GEN-LAST:event_cancelJBActionPerformed

	private void okJBActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_okJBActionPerformed
		setCancelled(false);
		setVisible(false);
	}// GEN-LAST:event_okJBActionPerformed

    @Override
    public Container getContentPane() {
        return contentPane;
    }
    
}
